home *** CD-ROM | disk | FTP | other *** search
/ Joystick Magazine 1995 July & August / cd No4 joystick No62.iso / mac / pc / SHARE / LIGHTLIB / LANGUAGE.Z / LLIDVIEW.H < prev    next >
C/C++ Source or Header  |  1995-02-20  |  4KB  |  119 lines

  1. // LLIDview.h : interface of the CLLIDView class
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4.  
  5. #define HINT_UPDATE_WINDOW      0
  6.  
  7.  
  8. //int _export OnIdle( DWORD dwType, 
  9. int EXPORTED OnIdle( DWORD dwType, 
  10.                     LONG  lParam,
  11.                     LLOBJECT pImage,
  12.                     DWORD dwAction,
  13.                     DWORD dwDevice,
  14.                     DWORD dwFormat,
  15.                     DWORD dwUdfParam );
  16.     
  17.     
  18.  
  19. class CLLIDView : public CScrollView
  20. {
  21. protected: // create from serialization only
  22.     CLLIDView();
  23.     DECLARE_DYNCREATE(CLLIDView)
  24.  
  25. // Attributes
  26. public:
  27.     CLLIDDoc* GetDocument();
  28.     BOOL ExclusivePaletteIsActive; // TRUE if no palette-sharing is wished
  29.  
  30. // Operations
  31. public:
  32.  
  33. // Implementation          
  34. public:
  35.     virtual ~CLLIDView();
  36.     virtual void OnDraw(CDC* pDC);  // overridden to draw this view
  37.     virtual void OnUpdate(CView* pSender, LPARAM lHint = 0L, CObject* pHint = NULL);
  38. //    virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint); // original
  39.     virtual void OnInitialUpdate();
  40.     virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo = NULL);
  41.     virtual BOOL OnScrollBy(CSize sizeScroll, BOOL bDoScroll);                      
  42.                                         
  43.                                         
  44.     // for information on these member functions please
  45.     // read their implementation source in LLIDVIEW.CPP
  46.     
  47.     void CaptureAll();
  48.     CRect GetSelection();         
  49.     void Fit( UINT fitmode );
  50.     void Zoom( float zfX, float zfY, BOOL crop );
  51.     void SwapInt(int *v1, int *v2);
  52.     void SwapFloat(float *v1, float *v2);
  53.     void Rotate( int angle );  
  54.                     
  55. //    void _export OnIdle();
  56.     void IdleStart(int times);
  57.     void IdleStop();
  58.  
  59.  
  60. #ifdef _DEBUG
  61.     virtual void AssertValid() const;
  62.     virtual void Dump(CDumpContext& dc) const;
  63. #endif
  64.  
  65. protected:
  66.     // zoom factor  
  67.     CSize m_zoomNum;
  68.     CSize m_zoomDenom;
  69.     
  70.     FARPROC pOnIdle;       // pointer to OnIdle function
  71.     
  72.     CRect CaptRect;        // used to select a part of the image with the mouse
  73.     BOOL CaptureIsVisible; // TRUE if the capture rectangle is visible
  74.     BOOL LButtonIsDown;    // TRUE if the left mousebutton is pressed down
  75.     CString  Coordinates;  // String to display coordinates of capturearea
  76.     float ScaleX, ScaleY;  // scalefactors for zoom function                
  77.     float ZoomX, ZoomY;    // zoomfactors for zooming in(+) and out(-)
  78.     int rotangle;          // current rotation angle used for image rotation
  79.     UINT CurrentFitMode;   // flag to control image fitting 
  80.     HCURSOR oldCursor;     // keep the old cursor when changing its apearance
  81.  
  82.  
  83.     // Printing support
  84.     virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
  85.     virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
  86.     virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
  87.  
  88. // Generated message map functions
  89. protected:
  90.     //{{AFX_MSG(CLLIDView)
  91.     afx_msg void OnPaint();
  92.     afx_msg void OnFilePrint();
  93.     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  94.     afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  95.     afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  96.     afx_msg void OnFitHor();
  97.     afx_msg void OnFitWin();
  98.     afx_msg void OnFitVer();
  99.     afx_msg void OnTogglePalette();
  100.     afx_msg void OnRotR90();
  101.     afx_msg void OnRotL90();
  102.     afx_msg void OnRot180();
  103.     afx_msg void OnSize(UINT nType, int cx, int cy);
  104.     afx_msg void OnUnfitWin();
  105.     afx_msg void OnImageInfo();
  106.     afx_msg void OnZoomIn();
  107.     afx_msg void OnZoomOut();
  108.     afx_msg void OnCrop();
  109.     //}}AFX_MSG
  110.     DECLARE_MESSAGE_MAP()
  111. };
  112.  
  113. #ifndef _DEBUG  // debug version in LLIDview.cpp
  114. inline CLLIDDoc* CLLIDView::GetDocument()
  115.    { return (CLLIDDoc*)m_pDocument; }
  116. #endif
  117.  
  118. /////////////////////////////////////////////////////////////////////////////
  119.